<template>
  <div class="fenlei">
    <!-- 标题 -->
    <h3 class="title">安晓东</h3>
    <!-- 搜索 -->
    <div class='search'>
      <div class="search-item">
        <van-icon name="search" class="search-icon"></van-icon>
        <span class="search-text">搜索</span>
      </div>    
    </div>
    <!-- 主体部分 -->
    <div class="main">
      <div class="main-left">
        <SlideBar @emitData="getData"></SlideBar>
      </div>
      <div class="main-right">
        <goods-list :fenleiList="fenleiList"></goods-list>
      </div>
    </div>
  </div>
</template>

<script>
import SlideBar from "../components/fenlei/SlideBar.vue"
import GoodsList from "../components/fenlei/GoodsList.vue"

export default {
  name:"FenLei",
  components:{
    SlideBar,
    GoodsList
  },
  data() {
    return {
      fenleiList:[]
    }
  },
  methods:{
    getData(v){
      this.fenleiList = v.children
    }
  }
}
</script>

<style scoped lang="less">
  .title{
    width: 100vw;
    height: 50px;
    background: #eb4450;
    color: #fff;
    text-align: center;
    line-height: 50px;
  }
  .search{
    background:#eb4450;
    height: 40px;
    padding: 10px 0px 0px;
    width: 100vw;
    .search-item{
      width: 90vw;
      margin: 0px auto;
      height: 30px;
      background: #fff;
      text-align: center;
      color: #999;
      line-height: 30px;
      border-radius: 3px;
    }   
  }
  .main{
    width: 100vw;
    height: calc(100vh - 100px);
    // background: #f00;
    display: flex;
    .main-left{
      width: 100px;
      // background: #00f;
      height: 100%;
    }
    .main-right{
      flex: 1;
      height: 100%;
      // background: #0f0;
    }
  }
</style>